home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / asmsrc / meltdown.lha / BOB-SOURCE / Flag.s < prev    next >
Encoding:
Text File  |  1988-07-19  |  5.8 KB  |  268 lines

  1. *****************************************************************************
  2. *                                                                           *
  3. *                                Bob Flag                                   *
  4. *                                                                           *
  5. *  Start Date : 10/3/91                                                     *
  6. * Last Update : 10/3/91                                                     *
  7. *                                  Code : Melt Down *
  8. *                                                                           *
  9. *****************************************************************************
  10.  
  11. ; Include the macros
  12.  
  13.     Incdir    Df1:
  14.     Include    Source/Macro
  15.  
  16. *****************************************************************************
  17.  
  18. ; Dont forget to use chip ram
  19.  
  20.     Chip
  21.     
  22. *****************************************************************************
  23.  
  24. ; Kill the operating system for good mesure
  25.  
  26.     Kill        
  27.     
  28. *****************************************************************************
  29.  
  30. ; Load custom and set up copper list
  31.  
  32.     Lea    Custom,A5
  33.     Move.l    #Copper,Cop1lch(a5)
  34.     
  35. *****************************************************************************
  36.  
  37. ; Main routine here
  38.  
  39. Mouse
  40.     Move.l    $dff004,d2
  41.     And.l    #$1ff00,d2    
  42.     Cmp.l    #$100,d2
  43.     Bne.s    Mouse
  44.         Eor.w    #$5000,ScreenPtr+2
  45.         Eor.w    #$5000,Plne1l+2
  46.         Eor.w    #$5000,Plne2l+2
  47.     Bsr    Clear
  48.     Bsr    DoFlag
  49.     Tstmice    Mouse                ; Pressed the mouse
  50.     
  51. *****************************************************************************
  52.  
  53. ; Return operating system and go back to user
  54.  
  55.     Heal
  56.     Clr.l    D0                ; No error
  57.     Rts
  58.     
  59. *****************************************************************************
  60.  
  61. Clear
  62.     Blitwait                ; Blitter Nasty But Why Do
  63.     Move.l    #$01000000,Bltcon0(a5)        ; Clear
  64.     Move.w    #$0000,Bltdmod(a5)        ; Skip No Bytes
  65.     Move.l    ScreenPtr,A0
  66.     Move.l    a0,Bltdpth(A5)            ; Set Dest
  67.     Move.l    #-1,Bltafwm(a5)            ; Use All Bits
  68.     Move.w    #220*64+20,Bltsize(a5)        ; Fill Half Screen
  69.     Movem.l    a0-a6/d0-d7,-(a7)        ; Save The Regs
  70.     Movem.l    RegFiller(pc),a1-a6/d0-d7    ; Clear The Regs
  71.     Add.w    #17600,A0
  72.     Rept    158
  73.     Movem.l    a1-a6/d0-d7,-(a0)        ; Clear 56 Butes
  74.     Endr                    ; End repeat
  75.     Movem.l    (a7)+,a0-a6/d0-d7        ; Restor Regs
  76.     Rts
  77. RegFiller
  78.     Dcb.l    16,0
  79.     Rts
  80.  
  81. *****************************************************************************
  82.  
  83. DoFlag
  84.     Blitwait
  85.     Move.w    #-2,Bltamod(a5)
  86.     Move.w    #-2,Bltbmod(a5)
  87.     Move.w    #36,Bltcmod(a5)
  88.     Move.w    #36,Bltdmod(a5)
  89.     Move.l    #$ffff0000,Bltafwm(a5)
  90.     Add.w    #4,Xptr
  91.     And.w    #$7e,Xptr
  92.     Add.w    #2,Yptr
  93.     And.w    #$7e,Yptr
  94.     Lea    Bobs,A0
  95.     Lea    XSin,A1
  96.     Add.w    Xptr,A1
  97.     Lea    YSin,A2
  98.     Add.w    Yptr,A2
  99.  
  100.     Lea    Shifts,A3
  101.     Move.l    #BobMask,a4
  102.     Move.l    #Bob,a6
  103.     Move.w    #16*64+2,D4
  104.     Move.l    ScreenPtr,D5
  105.     Move.w    (a0)+,d7
  106.  
  107.     Move.l    a4,bltapth(A5)
  108.     Move.l    a6,bltbpth(A5)
  109.     Move.l    D5,bltcpth(A5)
  110.     Move.l    D5,bltdpth(A5)
  111.     
  112.     Move.w    #8,D2
  113.     Move.w    #8,D3
  114.     Move.l    D5,D6
  115. BobLoop
  116.     Movem.w    (a0)+,d0-d1            ; Get X Y
  117.     Add.w    (a1),d0
  118.     Add.w    (a2),d1
  119.     Add.w    d2,a1
  120.     Add.w    d3,a2
  121.     Move.w    D6,D5
  122.     Add.w    D1,D5
  123.     Add.w    (a3,d0),D5            ; D5 Bob Pos
  124.     Move.l    2(a3,d0),Bltcon0(a5)
  125.     Move.w    a4,bltaptl(A5)
  126.     Move.w    a6,bltbptl(A5)
  127.     Move.w    D5,bltcptl(A5)
  128.     Move.w    D5,bltdptl(A5)
  129.     move.w    d4,bltsize(A5)
  130.     Dbf    D7,BobLoop
  131.     Rts
  132.     
  133. *****************************************************************************
  134.  
  135. StShift    Macro
  136.     Dc.w    \1,$0fca,$0000
  137.     Dc.w    \1,$1fca,$1000
  138.     Dc.w    \1,$2fca,$2000
  139.     Dc.w    \1,$3fca,$3000
  140.     Dc.w    \1,$4fca,$4000
  141.     Dc.w    \1,$5fca,$5000
  142.     Dc.w    \1,$6fca,$6000
  143.     Dc.w    \1,$7fca,$7000
  144.     Dc.w    \1,$8fca,$8000
  145.     Dc.w    \1,$9fca,$9000
  146.     Dc.w    \1,$afca,$a000
  147.     Dc.w    \1,$bfca,$b000
  148.     Dc.w    \1,$cfca,$c000
  149.     Dc.w    \1,$dfca,$d000
  150.     Dc.w    \1,$efca,$e000
  151.     Dc.w    \1,$ffca,$f000
  152.     Endm
  153. Shifts
  154.     StShift    0
  155.     StShift    2
  156.     StShift    4
  157.     StShift    6
  158.     StShift    8
  159.     StShift    10
  160.     StShift    12
  161.     StShift    14
  162.     StShift    16
  163.     StShift    18
  164.     StShift    20
  165.     StShift    22
  166.     StShift    24
  167.     StShift    26
  168.     StShift    28
  169.     StShift    30
  170.     StShift    32
  171.     StShift    34
  172.     StShift    36
  173.     StShift    38
  174.     StShift    40
  175.  
  176. *****************************************************************************
  177.  
  178. ScreenPtr
  179.     Dc.l    $70000
  180.     
  181. *****************************************************************************
  182.  
  183. ; All copper list after here
  184.  
  185. Copper
  186.  
  187.     Spr_Off                    ; Switch sprites off
  188.     Cmove    $2c81,Diwstrt
  189.     Cmove    $2cc1,Diwstop
  190.     Cmove    $0038,Ddfstrt
  191.     Cmove    $00d0,Ddfstop
  192.     Cmove    $0028,Bpl1mod            
  193.     Cmove    $0028,Bpl2mod
  194.     Cmove    $0000,Color00
  195.     Cmove    $0f00,Color01
  196.     Cmove    $0a00,Color02
  197.     Cmove    $0700,Color03
  198.     Cmove    $2200,Bplcon0
  199.     Cmove    $0007,Bpl1pth
  200. Plne1l    Cmove    $0000,Bpl1ptl
  201.     Cmove    $0007,Bpl2pth
  202. Plne2l    Cmove    $0028,Bpl2ptl
  203.     Endcop
  204.  
  205. *****************************************************************************
  206.  
  207. XY    Macro
  208.     Dc.w    \1*6,\2*80
  209.     Endm
  210. Bobs
  211. A    Set    0
  212.     Dc.w    150-1
  213.         Rept    10
  214.     Xy    005,(000+a)
  215.     Xy    025,(000+a)
  216.     Xy    045,(000+a)
  217.     Xy    065,(000+a)
  218.     Xy    085,(000+a)
  219.     Xy    105,(000+a)
  220.     Xy    125,(000+a)
  221.     Xy    145,(000+a)
  222.     Xy    165,(000+a)
  223.     Xy    185,(000+a)
  224.     Xy    205,(000+a)
  225.     Xy    225,(000+a)
  226.     Xy    245,(000+a)
  227.     Xy    265,(000+a)
  228.     Xy    285,(000+a)
  229. A    set    A+20
  230.         Endr
  231.     
  232. *****************************************************************************
  233.  
  234. XPtr
  235.     Dc.w    0
  236. YPtr
  237.     Dc.w    0
  238. XSin
  239.     Rept    14
  240.     dc.w    16*6,16*6,16*6,16*6,15*6,15*6,15*6,14*6
  241.     dc.w    14*6,13*6,12*6,12*6,11*6,10*6,10*6,9*6
  242.     dc.w    8*6,7*6,6*6,6*6,5*6,4*6,4*6,3*6
  243.     dc.w    2*6,2*6,1*6,1*6,1*6,0*6,0*6,0*6
  244.     dc.w    0*6,0*6,0*6,0*6,1*6,1*6,1*6,2*6
  245.     dc.w    2*6,3*6,4*6,4*6,5*6,6*6,6*6,7*6
  246.     dc.w    8*6,9*6,10*6,10*6,11*6,12*6,12*6,13*6
  247.     dc.w    14*6,14*6,15*6,15*6,15*6,16*6,16*6,16*6
  248.     Endr
  249. YSin
  250.     Rept    14
  251.     dc.w    16*80,16*80,16*80,16*80,15*80,15*80,15*80,14*80
  252.     dc.w    14*80,13*80,12*80,12*80,11*80,10*80,10*80,9*80
  253.     dc.w    8*80,7*80,6*80,6*80,5*80,4*80,4*80,3*80
  254.     dc.w    2*80,2*80,1*80,1*80,1*80,0*80,0*80,0*80
  255.     dc.w    0*80,0*80,0*80,0*80,1*80,1*80,1*80,2*80
  256.     dc.w    2*80,3*80,4*80,4*80,5*80,6*80,6*80,7*80
  257.     dc.w    8*80,9*80,10*80,10*80,11*80,12*80,12*80,13*80
  258.     dc.w    14*80,14*80,15*80,15*80,15*80,16*80,16*80,16*80
  259.     Endr
  260.     
  261. *****************************************************************************
  262.  
  263. Bob    Incbin    Gfx/8x8bob
  264. BobMask    Incbin    Gfx/8x8bobmask
  265.  
  266. *****************************************************************************
  267.     
  268.